<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org"
	xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
<head>
<meta charset="UTF-8"></meta>
<title>Insert title here</title>
<link rel="stylesheet" type="text/css"
	th:href="@{/static/easyui/themes/default/easyui.css}"></link>
<link rel="stylesheet" type="text/css"
	th:href="@{/static/easyui/themes/icon.css}"></link>
<script th:src="@{/static/easyui/jquery.min.js}"></script>
<script th:src="@{/static/easyui/jquery.easyui.min.js}"></script>
<script th:src="@{/static/easyui/locale/easyui-lang-zh_CN.js}"></script>
</head>
<body
	style="text-align: center; background-image: url(../static/images/login_bg.gif) ">
	<div style="width: 400px; margin: 10% auto;">
		<div class="easyui-panel" title="用户注册"
			style="width: 100%; max-width: 400px; padding: 30px 60px;">

			<form method="POST" th:object="${spitter}"
				th:action="@{/spitter/register}">
				<div class="errors" th:if="${#fields.hasErrors('*')}">
					<ul>
						<li th:each="err : ${#fields.errors('*')}" th:text="${err}">Input
							is incorrect</li>
					</ul>
				</div>
				<div style="margin-bottom: 10px">
					<input type="text" th:field="*{firstName}" class="easyui-textbox"
						style="width: 100%; height: 25px; padding: 12px"
						data-options="label: 'First Name:' ,required:true" />
				</div>
				<div style="margin-bottom: 10px">
					<input type="text" th:field="*{lastName}" class="easyui-textbox"
						style="width: 100%; height: 25px; padding: 12px"
						data-options="label: 'Last Name:' ,required:true" />
				</div>
				<div style="margin-bottom: 10px">
					<input type="text" th:field="*{email}" class="easyui-textbox"
						style="width: 100%; height: 25px; padding: 12px"
						data-options="label: 'Email:' ,required:true" />
				</div>
				<div style="margin-bottom: 10px">
					<input type="text" th:field="*{username}" class="easyui-textbox"
						style="width: 100%; height: 25px; padding: 12px"
						data-options="label: 'User Name:' ,required:true" />
				</div>
				<div style="margin-bottom: 10px">
					<input type="text" th:field="*{password}"
						class="easyui-passwordbox"
						style="width: 100%; height: 25px; padding: 12px"
						data-options="label: 'PassWord:' ,required:true" />
				</div>
				<div style="margin-bottom: 10px">
					<input class="easyui-linkbutton" type="submit" value="注册"
						style="padding: 5px 0px; width: 30%;" /> <input type="reset"
						value="重置" class="easyui-linkbutton"
						style="padding: 5px 0px; width: 30%;" />
				</div>
			</form>
		</div>
	</div>
	<script>
		$(document).ready(function() {
			$("#ttt").click(function() {
				$.post("/spitter/register", {
					username : 'ft111',
					password : '123123'
				}, function(data, status, xhr) {
					alert("Data:" + data + "nStatus:" + status + "xhr" + xhr);
					//window.location.href = "/";
					//document.write(data); 
				});
			});
			$("#tttt").click(function() {
				$('#f').submit();
			});
		});
		function submitForm() {
			$('#f').form('submit');
		}
		function clearForm() {
			$('#f').form('reset');
		}
	</script>
</body>
</html>